home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / jars / QuickNotepad.jar / changes40.txt < prev    next >
Text File  |  2012-05-31  |  5KB  |  100 lines

  1. $Id$
  2.  
  3. Changes made to QuickNotepad plugin for jEdit 4.0:
  4.  
  5. (1) Under jEdit 3.2.2 and prior versions, the plugin had a separate class,
  6. QuickNotepadDockable, implementing the DockableWindow interface. The class's
  7. methods delegated actions to the plugin's top-level visible component, a class
  8. derived from JPanel called QuickNotepad. The DockableWindow interface is
  9. deprecated in jEdit 4.0, so this class was eliminated. If the top-level
  10. component had implemented the DockableWindow interface, it would have been
  11. necessary to remove DockableWindow as an implemented interface and the eliminate
  12. the getName() and getComponent() methods of that interface in the plugin class.
  13.  
  14. (2) A new file, dockables.xml, was created containing XML markup for the
  15. constructor of a plugin component. Under the new plugin API, this file is read
  16. to determine the method call or calls for constructing a new instance of a
  17. dockable plugin component. The file is quite short:
  18.  
  19. <?xml version="1.0"?>
  20.  
  21. <!DOCTYPE DOCKABLES SYSTEM "dockables.dtd">
  22.  
  23. <!-- QuickNotepad dockable window -->
  24.  
  25. <DOCKABLES>
  26.   <DOCKABLE NAME="quicknotepad">
  27.     new QuickNotepad(view, position);
  28.   </DOCKABLE>
  29. </DOCKABLES>
  30.  
  31. The parameters are those found in the existing version of the QuickNotepad
  32. constructor. Both "view" and "position" are defined by the new plugin API in the
  33. namespace in which the constructor is called. The value of position is taken
  34. from optional properties set by the user. In the absence of a user setting, the
  35. position parameter is set to place the plugin component in a floating window.
  36.  
  37. The NAME attribute is taken to conform to the value of the static variable
  38. QuickNotepadPlugin.NAME, which is also used to identify the plugin in the user
  39. action code contained in actions.xml.
  40.  
  41. By default, the plugin API adds two actions for a plugin. The first is entitled
  42. [name of plugin] (in this case, "quicknotepad"), and simply activates the plugin
  43. by executing the code contained in the DOCKABLE element. The second action
  44. toggles the plugin's visible component, the title of the action is [name of
  45. plugin]-toggle (in this case, "quicknotepad-toggle"). The plugin API handles
  46. this action internally.
  47.  
  48. To prevent these actions from being created, you can add a NO_ACTIONS="true"
  49. attribute to the DOCKABLE element. The NAME and NO_ACTIONS attributes are the
  50. only attributes defined for a DOCKABLE entry. A NAME is required; NO_ACTIONS is
  51. set to "false" by default.
  52.  
  53. (3) In the actions.xml file, the user action definitions were revised to call
  54. DockableWindowManager.getDockable() instead of
  55. DockableManager.getDockableWindow(). In addition, the actions for toggling the
  56. plugin docking window and bringing the QuickNotepad window to the foreground
  57. were eliminated. The toggle action was duplicative of the built-in action
  58. supplied through dockables.xml, and the "bring to front" action had become
  59. redundant.
  60.  
  61. (4) There were two deletions made in QuickNotepadPlugin, the main plugin class.
  62.  
  63. The handleMessage() method was eliminated because it was only necessary for the
  64. plugin to listen for the CreateDockableWindow message. As a result, it is no
  65. longer necessary for this plugin to connect to the EditBus, so its derivation
  66. was changed from EBPlugin to EditPlugin. Individual instances of the
  67. QuickNotepad class still need to listen for a PropertiesChanged message, so that
  68. class continues to implement EBComponent.
  69.  
  70. In addition, since the EditBus no longer maintains an active list of windows,
  71. the call to EditBus.addToNamedList() is no longer needed in the class's start()
  72. method and so was eliminated, leaving an empty start() method.
  73.  
  74. (5) No changes were required in the option pane class, QuickNotepadOptionsPane,
  75. or the other other classes defining components of the plugin.
  76.  
  77. (6) Finally, several changes were made to the propoerties file of the plugin,
  78. QuickNotepad.props. First, the plugin's dependency properties were changed to
  79. make the plugin dependent upon version 4.0 or greater of jEdit:
  80.  
  81. plugin.QuickNotepadPlugin.depend.1=jedit 04.00.00.00
  82.  
  83. Next, the quicknotepad.title property was eliminated, and the "label" properties
  84. for the docking window and plugin menu were reorganized into two categories:
  85. labels for action created by dockable.xml (quicknotepad.label and
  86. quicknotepad-toggle.label), and labels for actions created by actions.xml (the
  87. remaining user actions: "choose-file", "save-file" and "copy-to-buffer").
  88.  
  89. The plugin was built using the standard build.xml supplied for plugins,
  90. after checking to make sure that the name of the plugin and the location of
  91. jedit.jar were correct. It was also necessary to add dockables.xml to the list
  92. of files to be archived by the jar utility. Iterations of the build process
  93. helped to uncover deprecated API elements.
  94.  
  95. The help file was built from DocBook XML source using xsltproc. The build.xml
  96. Ant build file and the users-guide.xsl customization file contain annotations
  97. which may be helpful in building plugin documentation. In particular, a few
  98. <indexterm> tags were added to the documentation source to provide references
  99. for the index to be generated for all plugin files.
  100.